import http from "@/utils/request/httpRequest.ts";
import type { ListRacetrackType, OtherListType } from "@/types/commonType.ts";
import outHttp from "@/utils/request/httpOutRequest.ts";

export const upload = (data: any) => http.upload('sysParam/exportXls', data)

export const uploadData = (data: any) => http.upload('sys/dict/exportXls', data)

export const userUpload = (data: any) => http.getUpload(`sys/user/exportXls?username=${data.username}&realname=${data.realname}&phone=${data.phone}`)

export const roleUpload = (data: any) => http.getUpload(`role/exportXls?roleName=${data.roleName}&roleCode=${data.roleCode}`)

// 字典查询
export const getDictByParentCode = (data: {
    dictCode: string
}) => http.get<OtherListType[]>(`sys/dict/getDictByParentCode`, {
    params: data
})

export const getDictByParentCodeOut = (data: {
    dictCode: string
}) => outHttp.get<OtherListType[]>(`sys/dict/getDictByParentCode`, {
    params: data
})


export const listRacetrack = () => http.get<ListRacetrackType[]>('sys/dict/listRacetrack')

export const listNormalRacetrack = () => http.get<ListRacetrackType[]>('sys/dict/listNormalRacetrack')

export const listRacetrackOut = () => outHttp.get<ListRacetrackType[]>('sys/dict/listRacetrack')

export const listNormalRacetrackOut = () => outHttp.get<ListRacetrackType[]>('sys/dict/listNormalRacetrack')

